<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" th:href="@{/static/element/index.css}"/>
</head>
<style>
</style>
<body>
<div id="app">
    <template>

        <el-table
                v-loading="loading"

                :data="tableData" row-key="tableName"
                :header-cell-style="{'text-align':'center','color':'grey','font-weight':'600'}"
                :cell-style="{'text-align':'center'}" border style="margin-top: 10px"

        >
            <el-table-column prop="table" label="表名" show-overflow-tooltip=""></el-table-column>
            <el-table-column label="建表SQL">
                <template slot-scope="scope">
                    <div v-html="scope.row.createTableDDL"></div>
                </template>
            </el-table-column>
        </el-table>


        <div style="text-align: center;margin-top: 5%">
            <el-button size="small" @click="closePage">取 消</el-button>
            <el-button size="small" type="primary" @click="handleSubmit">确 定</el-button>
        </div>
    </template>
</div>
</body>
<script th:src="@{/static/js/axios.min.js}"></script>
<script th:src="@{/static/js/request.js}"></script>
<script th:src="@{/static/js/common.js}"></script>
<script th:src="@{/static/api/gen.js}"></script>
<script th:src="@{/static/js/vue.min.js}"></script>
<script th:src="@{/static/element/index.js}"></script>
<script th:src="@{/static/js/jquery.min.js}"></script>
<script th:src="@{/static/layer/layer.js}"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                tableData: [],
                loading: false
            }
        },
        created() {
            this.handleQuery()
        },
        methods: {
            handleQuery() {
                this.loading = true
                let admin = parent._admin;
                console.log('===>' ,admin.tableName)
                tableStructure(admin.tableName).then(res => {
                    if (res.code === '200') {
                        console.log('===>' , res.data)
                        this.tableData.push(res.data)
                        console.log('===>' ,     this.tableData)
                        this.loading = false
                    } else {
                        this.loading = false
                    }
                });
            },
            handleSubmit() {
                addOrUpdate('/sys/menu/add', this);
                this.expandStatus = true
            }
        }
    });
</script>
</html>
